package com.test.market.controller;

import com.test.market.pojo.Supplier;
import com.test.market.service.SupplierService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

/**
 * @author 徒有琴
 */
@Controller
@RequestMapping("/supplier")
public class SupplierController {

    @Autowired
    private SupplierService supplierService;

    @RequestMapping("/list.html")
    public ModelAndView list(String name){
        List<Supplier> suppliers=supplierService.getSupplierList(name);
        return new ModelAndView("supplier_list","suppliers",suppliers);
    }
}
